/**
 * Description: 成员管理Api
 *
 * Created by hrx on 2023/10/25
 */

import service, {IResponseArrayDto, IResponseDto} from "@/utils/ajax";
import type {IBaseQueryDataListParams} from "@/api/index";
import {AxiosResponse} from "axios"

export interface queryMemberListParam {
  deptIdArrayList?: string,
  status?: string,
  userType?: string,
  filedSortType?: number,
  sortStatus?: string,
  tag?: number,
  userName?: string
}

export interface memberDetailDTO {
  id?: number,
  phoneNum?: string,
  userAccount?: string,
  userName?: string,
  gender?: string,
  idCardLastFour?: string,
  jobNum?: string,
  status?: number,
  userType?: number,
  origin?: number,
  createTime?: string,
  updateTime?: string,
  workPermitImage?: string,
  oneselfImage?: string,
  memberTypeName?: string,
  hospitalDeptName?: string,
  centralManageDeptName?: string,
  postName?: string,
  postNaturesName?: string,
  jobName?: string,
  creditCardNum?: string,
  managersDeptName?: string,
  responsibleDeptName?: string,
  responsibleNurseName?: string,
  tagName?: string,
  roleName?: string,
  hospitalIdSet?: string,
  deptIdSet?: string,
  memberTypeId?: number,
  deptId?: number,
  centralManageDeptId?: number,
  jobId?: number,
  postId?: number,
  postNaturesId?: number,
  tagIdList?: string,
  manageDeptList?: string,
  deptDataAuthPath?: string,
  hospitalDataAuthPath?: string,
}

export interface tagsDetailDTO {
  id?: number,
  tagName?: string,
  sortIndex?: number,
}

// 成员列表
export function getMemberListApi(data: IBaseQueryDataListParams<queryMemberListParam>): Promise<IResponseDto<IResponseArrayDto<memberDetailDTO>>> {
  return service({
    url: '/cloud/merchantSubUser/queryPage',
    method: 'post',
    data,
    headers: {showLoading: true},
  })
}

export function getTagsListApi(): Promise<AxiosResponse<IResponseDto<Array<tagsDetailDTO>>>> {
  return service({
    url: '/cloud/userTag/getTagsDataByMerchantCode',
    method: 'get',
    data: {},
    headers: {showLoading: true},
  })
}

// /cloud/userTag/getTagsDataByMerchantCode